
  update [User] set     
      [EmployeeNo] = b.[Badge] 
      ,[NameEN]  = b.[EName]
      ,[NameCN] = b.[Name]
      ,[Title] = b.[JobName]
      ,[OfficePhone] = b.[Extension] 
      ,[Mobile] = b.[Mobile]
      ,[Email] = b.[Email]
      ,[ReportTo] = b.[ReportTo]
      ,[BG] = b.[Platform_ARBR]
      ,[BD] = b.[Dep_ARBR] 
      ,[IsActive] = 1
      ,[SyncTime] = getDate()
from [eVW_EAI_Personal_Interface$] AS b
where [User].[Account] = b.[Ntaccount] and b.[Status] ='ON'

insert   into   [User]
      (
      [Account]
      ,[EmployeeNo] 
      ,[NameEN] 
      ,[NameCN]
      ,[Title]
      ,[OfficePhone]
      ,[Mobile]
      ,[Email]
      ,[ReportTo]
      ,[BG]
      ,[BD]
      ,[IsActive]
      ,[SyncTime]
      )
 (
 select distinct b.[Ntaccount]
      ,b.[Badge]
      ,b.[EName]
      ,b.[Name]
      ,b.[JobName]
      ,b.[Extension]
      ,b.[Mobile]
      ,b.[Email]
      ,b.[ReportTo]
      ,b.[Platform_ARBR]
      ,b.[Dep_ARBR] 
      ,1
      ,getDate()
      from [eVW_EAI_Personal_Interface$] as b
      where b.[Ntaccount] IS NOT NULL and b.[Status] ='ON' and b.[Ntaccount] not in
      (
      select [Account]
      from [User]
      )
  )